<?php

namespace App\Module\Admin\Validator;

use App\System\Base\Validator\BaseValidator;

class GoodsValidator extends BaseValidator
{

    protected $rules = [
        'name'    => 'required',
        'decription'  => 'required|between:1,140',
        'cost_price' => 'required|max:999999999.99',
        'stock'   => 'required|max:99999999999',
        'key_word' => 'required',
        'content' => 'required|between:1,20000',
    ];

    protected $messages = [
        'name.required'    => '请输入商品名称',
        'content.required'  => '请输入正文',
        'decription.required' => '请输入商品描述',
        'cost_price.required'     => '请输入成本价',
        'stock.required'     => '请输入库存',
        'key_word.required'     => '请输入关键字',
        'cost_price.max'     => '成本价不能高于999999999.99',
        'stock.max'     => '库存不能大于99999999999',
        'content.between'   => '正文长度在1~20000个汉字之间',
        'decription.between'   => '描述长度在1~140个汉字之间',
    ];

    protected $attributes = [

    ];
}